package com.vone.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.vone.entity.Basicdata;
import com.vone.entity.CsAttributeCompany;
import com.vone.entity.CsBaseSelect;
import com.vone.entity.CsBusinessPlan;
import com.vone.entity.CsCompanyPrize;
import com.vone.entity.CsCompanyPrizeSupport;
import com.vone.entity.CsCoreLeaguer;
import com.vone.entity.CsCoreLeaguerEdu;
import com.vone.entity.CsCoreStandardFormulation;
import com.vone.entity.CsCoreTecDrugApproval;
import com.vone.entity.CsCoreTecMedicalDeviceRegistration;
import com.vone.entity.CsCoreTecPatent;
import com.vone.entity.CsCoreTecSoftCopyright;
import com.vone.entity.CsCoreTechnology;
import com.vone.entity.CsFinancingExperience;
import com.vone.entity.CsInnovationService;
import com.vone.entity.CsInnovationServiceDemand;
import com.vone.entity.CsKeyword;
import com.vone.entity.CsShareholder;
import com.vone.entity.CsUserPlanRel;
import com.vone.entity.CscompanyPerson;
import com.vone.entity.Csfinancialforecastdata;
import com.vone.entity.Cshistoricalfinancialdata;
import com.vone.entity.ResearchSituation;
import com.vone.until.db.Connectiondb;

public class GetCompany {
	/**
	 * 查询总条数
	 * 
	 * @param map
	 * @param currentPage
	 * @return
	 */
	public static int getListfinanceTypeSum(Map<String, String> map) {
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		int sum = 0;
		// 基本sql语句
		String sql = "SELECT COUNT(1) FROM `cs_company` cc LEFT JOIN `cs_apply_schedule` cas ON cc.rel_id = cas.rel_id LEFT JOIN `cs_user_plan_rel` cupr ON cupr.id = cas.rel_id LEFT JOIN `cs_user` cu ON cu.id = cupr.user_id   LEFT JOIN `cs_company_person` ccp ON ccp.company_id = cc.id AND (ccp.person_type='3' OR ccp.person_type IS NULL)WHERE (ccp.person_type='3' OR ccp.person_type IS NULL)  AND cc.company_name IS NOT NULL";
		try {
			st = conn.createStatement();
			if (map.size() > 0) {
				if (map.get("company_name") != null && map.get("company_name") != ""
						&& map.get("company_name").length() > 0) {
					sql = sql + " AND cc.company_name like '%" + map.get("company_name") + "%'";
				}
				if (map.get("user_group_type") != null && map.get("user_group_type") != ""
						&& map.get("user_group_type").length() > 0) {
					if (!map.get("user_group_type").equals("-1"))
						sql = sql + " AND cu.user_group_type=" + map.get("user_group_type") + "";
				}
				if (map.get("submit") != null && map.get("submit") != "" && map.get("submit").length() > 0) {
					if (!map.get("submit").equals("-1"))
						sql = sql + " AND cas.submit = '" + map.get("submit") + "'";
				}
			}
			rs = st.executeQuery(sql);
			if (rs != null) {
				if (rs.next()) {
					sum = rs.getInt(1);
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return sum;
	}

	// 带搜索的模糊查询
	public static List<Map<String, String>> getListfinanceType(Map<String, String> map, int currentPage) {
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		List<Map<String, String>> list = null;
		// 基本sql语句
		String sql = "SELECT cupr.id,cu.username,cc.company_name,ccp.person_name,ccp.mobile,ccp.landline,cas.submit FROM `cs_company` cc LEFT JOIN `cs_apply_schedule` cas ON cc.rel_id = cas.rel_id LEFT JOIN `cs_user_plan_rel` cupr ON cupr.id = cas.rel_id LEFT JOIN `cs_user` cu ON cu.id = cupr.user_id   LEFT JOIN `cs_company_person` ccp ON ccp.company_id = cc.id AND (ccp.person_type='3' OR ccp.person_type IS NULL)WHERE (ccp.person_type='3' OR ccp.person_type IS NULL)  AND cc.company_name IS NOT NULL";
		try {
			st = conn.createStatement();
			if (map.size() > 0) {
				if (map.get("company_name") != null && map.get("company_name") != ""
						&& map.get("company_name").length() > 0) {
					sql = sql + " AND cc.company_name like '%" + map.get("company_name") + "%'";
				}
				if (map.get("user_group_type") != null && map.get("user_group_type") != ""
						&& map.get("user_group_type").length() > 0) {
					if (!map.get("user_group_type").equals("-1"))
						sql = sql + " AND cu.user_group_type=" + map.get("user_group_type") + "";
				}
				if (map.get("submit") != null && map.get("submit") != "" && map.get("submit").length() > 0) {
					if (!map.get("submit").equals("-1"))
						sql = sql + " AND cas.submit = '" + map.get("submit") + "'";
				}
			}
			sql = sql + " limit " + ((currentPage - 1) * 10) + ",10";
			rs = st.executeQuery(sql);
			if (rs != null) {
				list = new ArrayList<Map<String, String>>();
				while (rs.next()) {
					Map<String, String> m = new HashMap<String, String>();
					m.put("id", rs.getString("id"));
					m.put("username", rs.getString("username"));
					m.put("company_name", rs.getString("company_name"));
					m.put("person_name", rs.getString("person_name"));
					m.put("mobile", rs.getString("mobile"));
					m.put("landline", rs.getString("landline"));
					m.put("status", rs.getString("submit"));
					list.add(m);
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return list;
	}

	/**
	 * 导出所搜索的全部
	 * @param map
	 * @param currentPage
	 * @return
	 */
	public static List<Map<String, String>> getExecuteQueryExportAll(Map<String, String> map){
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		List<Map<String, String>> list = null;
		// 基本sql语句
		String sql = "SELECT cupr.id,cu.username,cc.company_name,ccp.person_name,ccp.mobile,ccp.landline,cas.submit FROM `cs_company` cc LEFT JOIN `cs_apply_schedule` cas ON cc.rel_id = cas.rel_id LEFT JOIN `cs_user_plan_rel` cupr ON cupr.id = cas.rel_id LEFT JOIN `cs_user` cu ON cu.id = cupr.user_id   LEFT JOIN `cs_company_person` ccp ON ccp.company_id = cc.id AND (ccp.person_type='3' OR ccp.person_type IS NULL)WHERE (ccp.person_type='3' OR ccp.person_type IS NULL)  AND cc.company_name IS NOT NULL";
		try {
			st = conn.createStatement();
			if (map.size() > 0) {
				if (map.get("company_name") != null && map.get("company_name") != ""
						&& map.get("company_name").length() > 0) {
					sql = sql + " AND cc.company_name like '%" + map.get("company_name") + "%'";
				}
				if (map.get("user_group_type") != null && map.get("user_group_type") != ""
						&& map.get("user_group_type").length() > 0) {
					if (!map.get("user_group_type").equals("-1"))
						sql = sql + " AND cu.user_group_type=" + map.get("user_group_type") + "";
				}
				if (map.get("submit") != null && map.get("submit") != "" && map.get("submit").length() > 0) {
					if (!map.get("submit").equals("-1"))
						sql = sql + " AND cas.submit = '" + map.get("submit") + "'";
				}
			}
			rs = st.executeQuery(sql);
			if (rs != null) {
				list = new ArrayList<Map<String, String>>();
				while (rs.next()) {
					Map<String, String> m = new HashMap<String, String>();
					m.put("id", rs.getString("id"));
					m.put("username", rs.getString("username"));
					m.put("company_name", rs.getString("company_name"));
					m.put("person_name", rs.getString("person_name"));
					m.put("mobile", rs.getString("mobile"));
					m.put("landline", rs.getString("landline"));
					m.put("status", rs.getString("submit"));
					list.add(m);
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return list;
	}
	
	
	
	
	// 查询出详细的信息列表
	@SuppressWarnings("resource")
	public static Basicdata actionDetail(String rel_id) {
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		// List<Basicdata> list = null;
		Basicdata basicdata = null;
		// 查询出基本信息
		String sql = "SELECT cc.*,cbs.option_name field_name,pca.name province_name,cca.name city_name,ce.type_name enterprise_type_name,ce2.type_name enterprise_type_child_name,cbs3.option_name purpose_name FROM `cs_company` cc	LEFT JOIN `cs_base_select` cbs ON cbs.id=cc.field_id AND cbs.type='3'		LEFT JOIN `cs_area` pca ON pca.id=cc.province_id	LEFT JOIN `cs_area` cca ON cca.id=cc.city_id	LEFT JOIN `cs_base_select` cbs3 ON cbs3.id=cc.purpose_id AND cbs3.type='5'	LEFT JOIN `cs_enterprise_type` ce ON ce.id = cc.enterprise_type_id	LEFT JOIN `cs_enterprise_type` ce2 ON ce2.id = cc.enterprise_type_child_id	"
				+ "WHERE cc.rel_id = '" + rel_id + "' LIMIT 1";
		try {
			st = conn.createStatement();
			rs = st.executeQuery(sql);
			// list = new ArrayList<Basicdata>();
			basicdata = new Basicdata();
			if (rs != null) {
				while (rs.next()) {
					basicdata.setId(rs.getString("id"));
					basicdata.setRel_id(rs.getString("rel_id"));
					basicdata.setCompany_name(rs.getString("company_name"));
					basicdata.setField_id(rs.getString("field_id"));
					basicdata.setProvince_id(rs.getString("province_id"));
					basicdata.setCity_id(rs.getString("city_id"));
					basicdata.setAttr_high_tech(rs.getString("attr_high_tech"));
					basicdata.setAttr_incubator(rs.getString("attr_incubator"));
					basicdata.setAttr_science_park(rs.getString("attr_science_park"));
					basicdata.setAttr_maker_space(rs.getString("attr_maker_space"));
					basicdata.setEnterprise_type_id(rs.getString("enterprise_type_id"));
					basicdata.setEnterprise_type_child_id(rs.getString("enterprise_type_child_id"));
					basicdata.setBusiness_licence_num(rs.getString("business_licence_num"));
					basicdata.setLience_img_url(rs.getString("licence_img_url"));
					basicdata.setFound_time(rs.getString("found_time"));
					basicdata.setOranization_code(rs.getString("organization_code"));
					basicdata.setRegistered_capital(rs.getString("registered_capital"));
					basicdata.setPaid_in_capital(rs.getString("paid_in_capital"));
					basicdata.setRegistered_address(rs.getString("registered_address"));
					basicdata.setRegistered_postcode(rs.getString("registered_postcode"));
					basicdata.setOffice_address(rs.getString("office_address"));
					basicdata.setOffice_postcode(rs.getString("office_postcode"));
					basicdata.setWebsite(rs.getString("website"));
					basicdata.setWechat(rs.getString("wechat"));
					basicdata.setPurpose_id(rs.getString("purpose_id"));
					basicdata.setOutline(rs.getString("outline"));
					basicdata.setEmployee_sum(rs.getString("employee_sum"));
					basicdata.setCollege_above_sum(rs.getString("college_above_sum"));
					basicdata.setDevelopers_sum(rs.getString("developers_sum"));
					basicdata.setListed_type_id(rs.getString("listed_type_id"));
					basicdata.setIs_neeq(rs.getString("is_neeq"));
					basicdata.setHigh_tech_rcv_time(rs.getString("high_tech_rcv_time"));
					basicdata.setTorch_program_rcv_time(rs.getString("torch_program_rcv_time"));
					basicdata.setCore_leaguer_img_url(rs.getString("core_leaguer_img_url"));
					basicdata.setField_name(rs.getString("field_name"));
					basicdata.setProvince_name(rs.getString("province_name"));
					basicdata.setCity_name(rs.getString("city_name"));
					basicdata.setEnterprise_type_name(rs.getString("enterprise_type_name"));
					basicdata.setEnterprise_type_child_name(rs.getString("enterprise_type_child_name"));
					basicdata.setPurpose_name(rs.getString("purpose_name"));
					// list.add(basicdata);
				}
				// 赋值企业名称
				if (basicdata.getAttr_high_tech() != null && basicdata.getAttr_high_tech() != "") {
					String sqlsecond = "SELECT attribute_name FROM `cs_attribute_company` WHERE id='"
							+ basicdata.getAttr_high_tech() + "' ";
					rs = st.executeQuery(sqlsecond);
					if (rs != null) {
						while (rs.next()) {
							basicdata.setAttr_high_tech_name(rs.getString("attribute_name"));
						}
					}
				}
				// 珠海孵化器
				if (basicdata.getAttr_incubator() != null && basicdata.getAttr_incubator() != "") {
					String sqlthree = "SELECT attribute_name FROM `cs_attribute_company` WHERE id='"
							+ basicdata.getAttr_incubator() + "'";// {$basic_data['attr_incubator']}
					rs = st.executeQuery(sqlthree);
					if (rs != null) {
						while (rs.next()) {
							basicdata.setAttr_incubator_name(rs.getString("attribute_name"));
						}
					}
				}

				// 珠海大学科技园
				if (basicdata.getAttr_science_park() != null && basicdata.getAttr_science_park() != "") {
					String sqlfour = "SELECT attribute_name FROM `cs_attribute_company` WHERE id='"
							+ basicdata.getAttr_science_park() + "'";
					rs = st.executeQuery(sqlfour);
					if (rs != null) {
						while (rs.next()) {
							basicdata.setAttr_science_park_name(rs.getString("attribute_name"));
						}
					}
				}
				// 珠海众创空间
				if (basicdata.getAttr_maker_space() != null && basicdata.getAttr_maker_space() != "") {
					String sqlfive = "SELECT attribute_name FROM `cs_attribute_company` WHERE id='"
							+ basicdata.getAttr_maker_space() + "'";
					rs = st.executeQuery(sqlfive);
					if (rs != null) {
						while (rs.next()) {
							basicdata.setAttr_maker_space_name(rs.getString("attribute_name"));
						}
					}
				}
				// 珠海大学科技园
				if (basicdata.getListed_type_id() != null && basicdata.getListed_type_id() != "") {
					String sqlsix = "SELECT attribute_name FROM `cs_attribute_company` WHERE id='"
							+ basicdata.getListed_type_id() + "'";
					rs = st.executeQuery(sqlsix);
					if (rs != null) {
						while (rs.next()) {
							basicdata.setListed_type_name(rs.getString("attribute_name"));
						}
					}
				}

				//// 获取 拥有国家或省级研发机构情况表
				String SQLONE = "SELECT * FROM cs_research_situation WHERE rel_id = '" + rel_id + "'";
				rs = st.executeQuery(SQLONE);
				ResearchSituation researchsituation = null;
				if (rs != null) {
					while (rs.next()) {
						researchsituation = new ResearchSituation();
						researchsituation.setId(rs.getString("id"));
						researchsituation.setRel_id(rs.getString("rel_id"));
						researchsituation.setName(rs.getString("name"));
						researchsituation.setLevel(rs.getString("level"));
						researchsituation.setFile_name(rs.getString("file_name"));
						basicdata.setResearchsituation(researchsituation);// 添加研发机构情况表
					}
				}
				// 获取企业相关人员
				String SQLTWO = "SELECT * FROM `cs_company_person` WHERE company_id='" + basicdata.getId()
						+ "' ORDER BY person_type ASC ";
				rs = st.executeQuery(SQLTWO);
				List<CscompanyPerson> cscompanyPerson = new ArrayList<>();
				if (rs != null) {
					while (rs.next()) {
						CscompanyPerson cscompanyPerson1 = new CscompanyPerson();
						cscompanyPerson1.setId(rs.getString("id"));
						cscompanyPerson1.setCompany_id(rs.getString("company_id"));
						cscompanyPerson1.setPerson_name(rs.getString("person_name"));
						cscompanyPerson1.setSex(rs.getString("sex"));
						cscompanyPerson1.setAge(rs.getString("age"));
						cscompanyPerson1.setDegree_id(rs.getString("degree_id"));
						cscompanyPerson1.setPost(rs.getString("post"));
						cscompanyPerson1.setLandline(rs.getString("landline"));
						cscompanyPerson1.setMobile(rs.getString("mobile"));
						cscompanyPerson1.setEmail(rs.getString("email"));
						cscompanyPerson1.setPerson_type(rs.getString("person_type"));
						cscompanyPerson.add(cscompanyPerson1);

					}
				}
				basicdata.setCscompanyPerson(cscompanyPerson);
				// 获取学历
				String SQLTHREE = "SELECT id,option_name FROM `cs_base_select` WHERE type='2' ORDER BY sort";
				rs = st.executeQuery(SQLTHREE);
				CsBaseSelect csbaseselect = null;
				if (rs != null) {
					while (rs.next()) {
						csbaseselect = new CsBaseSelect();
						csbaseselect.setId(rs.getString("id"));
						csbaseselect.setOption_name(rs.getString("option_name"));
						basicdata.setCsbaseselect(csbaseselect);
					}
				}

				// 获奖与支持
				String SQLFOUR = "SELECT * FROM `cs_company_prize` WHERE  rel_id = '" + rel_id + "' ";
				rs = st.executeQuery(SQLFOUR);
				List<CsCompanyPrize> cscompanyprize = new ArrayList<>();
				if (rs != null) {
					while (rs.next()) {
						CsCompanyPrize	cscompanyprize1 = new CsCompanyPrize();
						cscompanyprize1.setId(rs.getString("id"));
						cscompanyprize1.setRel_id(rs.getString("rel_id"));
						cscompanyprize1.setName(rs.getString("name"));
						cscompanyprize1.setPrize_type_id(rs.getString("prize_type_id"));
						cscompanyprize1.setCompany_id(rs.getString("company_id"));
						cscompanyprize1.setReceive_time(rs.getString("receive_time"));
						cscompanyprize1.setType(rs.getString("type"));
						cscompanyprize.add(cscompanyprize1);
					}
					basicdata.setCscompanyprize(cscompanyprize);
				}
				String SQLFOUR2 = "SELECT ccp.receive_time,cbs.option_name FROM cs_company_prize ccp	LEFT JOIN `cs_base_select`  cbs ON ccp.prize_type_id = cbs.id	WHERE ccp.rel_id = '"
						+ rel_id + "' AND ccp.type='3' LIMIT 1 ";
				rs = st.executeQuery(SQLFOUR2);
				CsCompanyPrizeSupport cscompanyprizesupport = null;
				if (rs != null) {
					while (rs.next()) {
						cscompanyprizesupport = new CsCompanyPrizeSupport();
						cscompanyprizesupport.setReceive_time(rs.getString("receive_time"));
						cscompanyprizesupport.setOption_name(rs.getString("option_name"));
						basicdata.setCscompanyprizesupport(cscompanyprizesupport);

					}
				}
				// 获取核心技术
				String SQLFIVE = "SELECT * FROM `cs_core_technology` WHERE rel_id='" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(SQLFIVE);
				CsCoreTechnology cscoretechnology = null;
				if (rs != null) {
					while (rs.next()) {
						cscoretechnology = new CsCoreTechnology();
						cscoretechnology.setId(rs.getString("id"));
						cscoretechnology.setRel_id(rs.getString("rel_id"));
						cscoretechnology.setIs_patent(rs.getString("is_patent"));
						cscoretechnology.setIs_copyright(rs.getString("is_copyright"));
						cscoretechnology.setIs_drug(rs.getString("is_drug"));
						cscoretechnology.setIs_medical(rs.getString("is_medical"));
						cscoretechnology.setIs_standards(rs.getString("is_standards"));
						cscoretechnology.setIs_ic_layout(rs.getString("is_ic_layout"));
						cscoretechnology.setIs_other(rs.getString("is_other"));
						cscoretechnology.setOther_content(rs.getString("other_content"));
						cscoretechnology.setTec_source(rs.getString("tec_source"));
						cscoretechnology.setOther_source(rs.getString("other_source"));
						cscoretechnology.setTec_conversion(rs.getString("tec_conversion"));
						cscoretechnology.setUniversities_name(rs.getString("universities_name"));
						cscoretechnology.setPlan_name(rs.getString("plan_name"));
						basicdata.setCscoretechnology(cscoretechnology);
					}
				}
				// 专利
				if (Integer.parseInt(cscoretechnology.getIs_patent()) == 1
						&& cscoretechnology.getIs_patent().equals("1")) {
					String SQLSIX = "SELECT a.*,b.option_name FROM `cs_core_tec_patent` a  LEFT JOIN `cs_base_select` b ON a.patent_type_id = b.id AND b.type='11' WHERE a.tec_id='"
							+ cscoretechnology.getId() + "'";// {$technology_data['id']}
					rs = st.executeQuery(SQLSIX);
					List<CsCoreTecPatent> cscoretecpatent=new ArrayList<>();
					while (rs.next()) {
						CsCoreTecPatent cscoretecpatent1 = new CsCoreTecPatent();
						cscoretecpatent1.setId(rs.getString("id"));
						cscoretecpatent1.setTec_id(rs.getString("tec_id"));
						cscoretecpatent1.setPatent_type_id(rs.getString("patent_type_id"));
						cscoretecpatent1.setPatent_name(rs.getString("patent_name"));
						cscoretecpatent1.setPatent_num(rs.getString("patent_num"));
						cscoretecpatent1.setReceive_time(rs.getString("receive_time"));
						cscoretecpatent1.setOption_name(rs.getString("option_name"));
						cscoretecpatent.add(cscoretecpatent1);
					}
					basicdata.setCscoretecpatent(cscoretecpatent);
					
				}
				// 软件著作权
				if (Integer.parseInt(cscoretechnology.getIs_copyright()) == 1
						&& cscoretechnology.getIs_copyright().equals("1")) {
					String SQLSEVEN = "SELECT * FROM `cs_core_tec_soft_copyright` WHERE tec_id='"
							+ cscoretechnology.getId() + "'";
					rs = st.executeQuery(SQLSEVEN);
					List<CsCoreTecSoftCopyright> cscoretecsoftcopyright=new ArrayList<>();
					while (rs.next()) {
						CsCoreTecSoftCopyright cscoretecsoftcopyright1 = new CsCoreTecSoftCopyright();
						cscoretecsoftcopyright1.setId(rs.getString("id"));
						cscoretecsoftcopyright1.setTec_id(rs.getString("tec_id"));
						cscoretecsoftcopyright1.setCopyright_name(rs.getString("copyright_name"));
						cscoretecsoftcopyright1.setCopyright_person(rs.getString("copyright_person"));
						cscoretecsoftcopyright1.setCopyright_num(rs.getString("copyright_num"));
						cscoretecsoftcopyright1.setReceive_time(rs.getString("receive_time"));
						cscoretecsoftcopyright.add(cscoretecsoftcopyright1);
					}
					basicdata.setCscoretecsoftcopyright(cscoretecsoftcopyright);
				}
				
				//药品批文表（核心技术）
				if (Integer.parseInt(cscoretechnology.getIs_copyright()) == 1
						&& cscoretechnology.getIs_copyright().equals("1")) {
					String SQLSEVEN = "SELECT * FROM `cs_core_tec_drug_approval` WHERE tec_id='"
							+ cscoretechnology.getId() + "'";
					rs = st.executeQuery(SQLSEVEN);
					List<CsCoreTecDrugApproval> csCoreTecDrugApproval=new ArrayList<>();
					while (rs.next()) {
						CsCoreTecDrugApproval CsCoreTecDrugApproval1 = new CsCoreTecDrugApproval();
						CsCoreTecDrugApproval1.setId(rs.getString("id"));
						CsCoreTecDrugApproval1.setTec_id(rs.getString("tec_id"));
						CsCoreTecDrugApproval1.setDrug_name(rs.getString("drug_name"));
						CsCoreTecDrugApproval1.setNew_drug(rs.getString("new_drug"));
						CsCoreTecDrugApproval1.setProtect_drug(rs.getString("protect_drug"));
						CsCoreTecDrugApproval1.setDrug_num(rs.getString("drug_num"));
						CsCoreTecDrugApproval1.setActive_time(rs.getString("active_time"));
						csCoreTecDrugApproval.add(CsCoreTecDrugApproval1);
					}
					basicdata.setCsCoreTecDrugApproval(csCoreTecDrugApproval);
				}
				// 医疗器械注册证
				if (Integer.parseInt(cscoretechnology.getIs_medical()) == 1
						&& cscoretechnology.getIs_medical().equals("1")) {
					String SQLEIGHT = "SELECT * FROM `cs_core_tec_medical_device_registration` WHERE tec_id='"
							+ cscoretechnology.getId() + "' ";
					rs = st.executeQuery(SQLEIGHT);
					List<CsCoreTecMedicalDeviceRegistration> cscoretecmedicaldeviceregistration=new ArrayList<>();
					while (rs.next()) {
						CsCoreTecMedicalDeviceRegistration cscoretecmedicaldeviceregistration1 = new CsCoreTecMedicalDeviceRegistration();
						cscoretecmedicaldeviceregistration1.setId(rs.getString("id"));
						cscoretecmedicaldeviceregistration1.setTec_id(rs.getString("tec_id"));
						cscoretecmedicaldeviceregistration1.setInstrument_name(rs.getString("instrument_name"));
						cscoretecmedicaldeviceregistration1.setRegistration_number(rs.getString("registration_number"));
						cscoretecmedicaldeviceregistration1.setActive_time(rs.getString("active_time"));
						cscoretecmedicaldeviceregistration.add(cscoretecmedicaldeviceregistration1);
					}
					basicdata.setCscoretecmedicaldeviceregistration(cscoretecmedicaldeviceregistration);
				}
				// 企业参与国际或国家或行业标准制定情况
				if (Integer.parseInt(cscoretechnology.getIs_standards()) == 1
						&& cscoretechnology.getIs_standards().equals("1")) {
					String SQLTEN = "SELECT * FROM cs_core_standard_formulation WHERE tec_id = '"
							+ cscoretechnology.getId() + "'";
					rs = st.executeQuery(SQLTEN);
					List<CsCoreStandardFormulation> cscorestandardformulation=new ArrayList<>();
					while (rs.next()) {
						CsCoreStandardFormulation cscorestandardformulation1 = new CsCoreStandardFormulation();
						cscorestandardformulation1.setId(rs.getString("id"));
						cscorestandardformulation1.setTec_id(rs.getString("tec_id"));
						cscorestandardformulation1.setName(rs.getString("name"));
						cscorestandardformulation1.setLevel(rs.getString("level"));
						cscorestandardformulation1.setCode(rs.getString("code"));
						cscorestandardformulation1.setStatus(rs.getString("status"));
						cscorestandardformulation.add(cscorestandardformulation1);
					}
					basicdata.setCscorestandardformulation(cscorestandardformulation);
				}
				// 关键词
				String MSQL = "SELECT keyword FROM `cs_keyword` WHERE rel_id='" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(MSQL);
				CsKeyword cskeyword;
				while (rs.next()) {
					cskeyword = new CsKeyword();
					cskeyword.setKeyword(rs.getString("keyword"));
					basicdata.setCskeyword(cskeyword);
				}

				// 获取股东信息
				String MSQLtwo = "SELECT cs.*,cbs.option_name shareholder_type,cbs2.option_name investment_form FROM `cs_shareholder` cs	LEFT JOIN `cs_base_select` cbs ON cbs.id=cs.shareholder_type_id AND cbs.type='8'  LEFT JOIN `cs_base_select` cbs2 ON cbs2.id=cs.investment_form_id AND cbs2.type='9' "
						+ "WHERE rel_id='" + rel_id + "'";
				rs = st.executeQuery(MSQLtwo);
				List<CsShareholder> csshareholder = new ArrayList<>();
				CsShareholder csshareholder1;
				while (rs.next()) {
					csshareholder1 = new CsShareholder();
					csshareholder1.setId(rs.getString("id"));
					csshareholder1.setRel_id(rs.getString("rel_id"));
					csshareholder1.setShareholder_name(rs.getString("shareholder_name"));
					csshareholder1.setShareholder_type_id(rs.getString("shareholder_type_id"));
					csshareholder1.setPayable_money(rs.getString("payable_money"));
					csshareholder1.setActual_money(rs.getString("actual_money"));
					csshareholder1.setInvestment_form_id(rs.getString("investment_form_id"));
					csshareholder1.setRate(rs.getString("rate"));
					csshareholder1.setShareholder_type(rs.getString("shareholder_type"));
					csshareholder1.setInvestment_form(rs.getString("investment_form"));
					csshareholder.add(csshareholder1);
				}
				basicdata.setCsshareholder(csshareholder);

				// 获取核心团队
				String MSQTHREE = "SELECT ccl.*,cbs.option_name FROM `cs_core_leaguer` ccl LEFT JOIN `cs_base_select` cbs ON ccl.degree_id=cbs.id AND cbs.type='2'	"
						+ "WHERE ccl.rel_id='" + rel_id + "' ";
				rs = st.executeQuery(MSQTHREE);
				List<CsCoreLeaguer> csshareholderlist = new ArrayList<CsCoreLeaguer>();
				CsCoreLeaguer cscoreLeaguer = null;
				while (rs.next()) {
					cscoreLeaguer = new CsCoreLeaguer();
					cscoreLeaguer.setId(rs.getString("id"));
					cscoreLeaguer.setRel_id(rs.getString("rel_id"));
					cscoreLeaguer.setLeaguer_name(rs.getString("leaguer_name"));
					cscoreLeaguer.setSex(rs.getString("sex"));
					cscoreLeaguer.setAge(rs.getString("age"));
					cscoreLeaguer.setPost(rs.getString("post"));
					cscoreLeaguer.setTitle(rs.getString("title"));
					cscoreLeaguer.setDegree_id(rs.getString("degree_id"));
					cscoreLeaguer.setIs_study_abroad(rs.getString("is_study_abroad"));
					cscoreLeaguer.setIs_thousand_program(rs.getString("is_thousand_program"));
					cscoreLeaguer.setThousand_program_time(rs.getString("thousand_program_time"));
					cscoreLeaguer.setIs_student_entrepreneurship(rs.getString("is_student_entrepreneurship"));
					cscoreLeaguer.setEntrepreneurship_times(rs.getString("entrepreneurship_times"));
					cscoreLeaguer.setIs_academician(rs.getString("is_academician"));
					cscoreLeaguer.setEdu_bg_ids(rs.getString("edu_bg_ids"));
					cscoreLeaguer.setWork_experience(rs.getString("work_experience"));
					cscoreLeaguer.setAchievement(rs.getString("achievement"));
					cscoreLeaguer.setOption_name(rs.getString("option_name"));
					csshareholderlist.add(cscoreLeaguer);
				}
				
					if(csshareholderlist.size()>0){
					List<CsCoreLeaguerEdu> cscoreleagueredus=new ArrayList<CsCoreLeaguerEdu>();
					CsCoreLeaguerEdu csCoreLeaguerEdu;
					for(int i=0;i<csshareholderlist.size();i++){
						String MSQTHREECHILDS="SELECT ccle.*,cbs.option_name FROM `cs_core_leaguer_edu` ccle LEFT JOIN `cs_base_select` cbs ON ccle.degree_id=cbs.id AND cbs.type='2'	"
								+ "WHERE ccle.leaguer_id = '"+csshareholderlist.get(i).getId()+"' ";
						rs=st.executeQuery(MSQTHREECHILDS);
						while(rs.next()){
							csCoreLeaguerEdu=new CsCoreLeaguerEdu();
							csCoreLeaguerEdu.setId(rs.getString("id"));
							csCoreLeaguerEdu.setLeaguer_id(rs.getString("leaguer_id"));
							csCoreLeaguerEdu.setDegree_id(rs.getString("degree_id"));
							csCoreLeaguerEdu.setSchool_name(rs.getString("school_name"));
							csCoreLeaguerEdu.setMajor(rs.getString("major"));
							csCoreLeaguerEdu.setGraduation_time(rs.getString("graduation_time"));
							csCoreLeaguerEdu.setOption_name(rs.getString("option_name"));
							cscoreleagueredus.add(csCoreLeaguerEdu);
						}
						cscoreLeaguer.setCscoreleagueredu(cscoreleagueredus);
				
					}
				}
				basicdata.setCscoreLeaguer(csshareholderlist);

				// 获取商业计划书
				// 获取上部分信息
				String MSQlfour = "SELECT * FROM `cs_business_plan` WHERE rel_id='" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(MSQlfour);
				CsBusinessPlan csbusinessplan;
				while (rs.next()) {
					csbusinessplan = new CsBusinessPlan();
					csbusinessplan.setId(rs.getString("id"));
					csbusinessplan.setRel_id(rs.getString("rel_id"));
					csbusinessplan.setProject_name(rs.getString("project_name"));
					csbusinessplan.setIncome_rate(rs.getString("income_rate"));
					csbusinessplan.setIs_domestic_leading(rs.getString("is_domestic_leading"));
					csbusinessplan.setIs_international_leading(rs.getString("is_international_leading"));
					csbusinessplan.setHas_similar_tec_research_org(rs.getString("has_similar_tec_research_org"));
					csbusinessplan.setResearch_org_name(rs.getString("research_org_name"));
					csbusinessplan.setHas_product_img(rs.getString("has_product_img"));
					csbusinessplan.setComment(rs.getString("comment"));
					csbusinessplan.setProduct_img_url(rs.getString("product_img_url"));
					csbusinessplan.setMarket_analysis(rs.getString("market_analysis"));
					csbusinessplan.setTop_five_customer(rs.getString("top_five_customer"));
					csbusinessplan.setTop_five_supplier(rs.getString("top_five_supplier"));
					csbusinessplan.setHas_international_competitor(rs.getString("has_international_competitor"));
					csbusinessplan.setInternational_competitor_name(rs.getString("international_competitor_name"));
					csbusinessplan
							.setIs_listed_international_competitor(rs.getString("is_listed_international_competitor"));
					csbusinessplan.setInternational_competitor_market_share_rate(
							rs.getString("international_competitor_market_share_rate"));
					csbusinessplan.setHas_domestic_competitor(rs.getString("has_domestic_competitor"));
					csbusinessplan.setDomestic_competitor_name(rs.getString("domestic_competitor_name"));
					csbusinessplan.setIs_listed_domestic_competitor(rs.getString("is_listed_domestic_competitor"));
					csbusinessplan.setDomestic_competitor_market_share_rate(
							rs.getString("domestic_competitor_market_share_rate"));
					csbusinessplan.setDomestic_ranking(rs.getString("domestic_ranking"));
					csbusinessplan.setMarket_share_rate(rs.getString("market_share_rate"));
					csbusinessplan.setCompetitive_edge(rs.getString("competitive_edge"));
					csbusinessplan.setCompetitive_description(rs.getString("competitive_description"));
					csbusinessplan.setBusiness_model(rs.getString("business_model"));
					csbusinessplan.setExpand_plan(rs.getString("expand_plan"));
					csbusinessplan.setHas_economic_litigation(rs.getString("has_economic_litigation"));
					csbusinessplan.setEconomic_litigation_reason(rs.getString("economic_litigation_reason"));
					csbusinessplan.setHas_environment_litigation(rs.getString("has_environment_litigation"));
					csbusinessplan.setEnvironment_litigation_reason(rs.getString("environment_litigation_reason"));
					csbusinessplan.setHas_other_litigation(rs.getString("has_other_litigation"));
					csbusinessplan.setOther_litigation_content(rs.getString("other_litigation_content"));
					csbusinessplan.setOther_litigation_reason(rs.getString("other_litigation_reason"));
					csbusinessplan.setIs_excitation_mechanism(rs.getString("is_excitation_mechanism"));
					csbusinessplan.setIs_esop(rs.getString("is_esop"));
					csbusinessplan.setOther_tec_product_service(rs.getString("other_tec_product_service"));
					csbusinessplan.setMain_business(rs.getString("main_business"));
					basicdata.setCsbusinessplan(csbusinessplan);
				}

				// 获取下部门信息 - 历史
				String MSQlfive = "SELECT * FROM `cs_historical_financial_data` WHERE  rel_id='" + rel_id
						+ "' LIMIT 1 ";
				rs = st.executeQuery(MSQlfive);
				Cshistoricalfinancialdata cshistoricalfinancialdata;
				while (rs.next()) {
					cshistoricalfinancialdata = new Cshistoricalfinancialdata();
					cshistoricalfinancialdata.setId(rs.getString("id"));
					cshistoricalfinancialdata.setRel_id(rs.getString("rel_id"));
					cshistoricalfinancialdata.setIncome(rs.getString("income"));
					cshistoricalfinancialdata.setCost(rs.getString("cost"));
					cshistoricalfinancialdata.setTax_and_additional(rs.getString("tax_and_additional"));
					cshistoricalfinancialdata.setBusiness_expenses(rs.getString("business_expenses"));
					cshistoricalfinancialdata.setManagement_expenses(rs.getString("management_expenses"));
					cshistoricalfinancialdata.setFinancial_expenses(rs.getString("financial_expenses"));
					cshistoricalfinancialdata.setResearch_expenses(rs.getString("research_expenses"));
					cshistoricalfinancialdata.setProfit(rs.getString("profit"));
					cshistoricalfinancialdata.setProfit_rate(rs.getString("profit_rate"));
					cshistoricalfinancialdata
							.setNonoperating_revenues_and_expenses(rs.getString("nonoperating_revenues_and_expenses"));
					cshistoricalfinancialdata.setTotal_profit(rs.getString("total_profit"));
					cshistoricalfinancialdata.setNet_profit(rs.getString("net_profit"));
					cshistoricalfinancialdata.setMonetary_fund(rs.getString("monetary_fund"));
					cshistoricalfinancialdata.setReceivable(rs.getString("receivable"));
					cshistoricalfinancialdata.setInventory(rs.getString("inventory"));
					cshistoricalfinancialdata.setNet_fixed_assets(rs.getString("net_fixed_assets"));
					cshistoricalfinancialdata.setIntangible_assets(rs.getString("intangible_assets"));
					cshistoricalfinancialdata.setTotal_assets(rs.getString("total_assets"));
					cshistoricalfinancialdata.setPayables(rs.getString("payables"));
					cshistoricalfinancialdata.setShort_term_loan(rs.getString("short_term_loan"));
					cshistoricalfinancialdata.setLong_term_loan(rs.getString("long_term_loan"));
					cshistoricalfinancialdata.setTotal_loan(rs.getString("total_loan"));
					cshistoricalfinancialdata.setNet_assets(rs.getString("net_assets"));
					basicdata.setCshistoricalfinancialdata(cshistoricalfinancialdata);
				}

				// 获取下部门信息 - 预测
				String MSQlsix = "SELECT * FROM `cs_financial_forecast_data` WHERE  rel_id='" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(MSQlsix);
				Csfinancialforecastdata csfinancialforecastdata;
				while (rs.next()) {
					csfinancialforecastdata = new Csfinancialforecastdata();
					csfinancialforecastdata.setId(rs.getString("id"));
					csfinancialforecastdata.setRel_id(rs.getString("rel_id"));
					csfinancialforecastdata.setIncome(rs.getString("income"));
					csfinancialforecastdata.setCost(rs.getString("cost"));
					csfinancialforecastdata.setTax_and_additional(rs.getString("tax_and_additional"));
					csfinancialforecastdata.setNet_profit(rs.getString("net_profit"));
					basicdata.setCsfinancialforecastdata(csfinancialforecastdata);
				}

				// 获取创业服务
				// 融资经历
				String MSQlseven = "SELECT * FROM `cs_financing_experience` WHERE rel_id = '" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(MSQlseven);
				CsFinancingExperience csfinancingexperience;
				while (rs.next()) {
					csfinancingexperience = new CsFinancingExperience();
					csfinancingexperience.setId(rs.getString("id"));
					csfinancingexperience.setRel_id(rs.getString("rel_id"));
					csfinancingexperience.setHas_equity_financing(rs.getString("has_equity_financing"));
					csfinancingexperience.setInvestor(rs.getString("Investor"));
					csfinancingexperience.setFinancing_amount(rs.getString("financing_amount"));
					csfinancingexperience.setEquity_rate(rs.getString("equity_rate"));
					csfinancingexperience.setFinancing_time(rs.getString("financing_time"));
					csfinancingexperience.setHas_debt_financing(rs.getString("has_debt_financing"));
					csfinancingexperience.setLender(rs.getString("lender"));
					csfinancingexperience.setLoan_amount(rs.getString("loan_amount"));
					csfinancingexperience.setLoan_start_time(rs.getString("loan_start_time"));
					csfinancingexperience.setLoan_end_time(rs.getString("loan_end_time"));
					csfinancingexperience.setFinancing_stage(rs.getString("financing_stage"));
					csfinancingexperience.setOther_stage_name(rs.getString("other_stage_name"));
					basicdata.setCsfinancingexperience(csfinancingexperience);
				}
				// 创业服务
				String MSQleight = "SELECT * FROM `cs_innovation_service` WHERE rel_id = '" + rel_id + "' LIMIT 1 ";
				rs = st.executeQuery(MSQleight);
				CsInnovationService csinnovationservice;
				while (rs.next()) {
					csinnovationservice = new CsInnovationService();
					csinnovationservice.setId(rs.getString("id"));
					csinnovationservice.setRel_id(rs.getString("rel_id"));
					csinnovationservice.setHas_equity_financing(rs.getString("has_equity_financing"));
					csinnovationservice.setEquity_financing_amount(rs.getString("equity_financing_amount"));
					csinnovationservice.setEquity_rate(rs.getString("equity_rate"));
					csinnovationservice.setEquity_financing_time(rs.getString("equity_financing_time"));
					csinnovationservice.setEquity_fund_use_plan(rs.getString("equity_fund_use_plan"));
					csinnovationservice.setIs_apply_investment_org(rs.getString("is_apply_investment_org"));
					csinnovationservice.setHas_debt_financing(rs.getString("has_debt_financing"));
					csinnovationservice.setDebt_financing_amount(rs.getString("debt_financing_amount"));
					csinnovationservice.setAcceptable_max_annual_interest_rate(
							rs.getString("acceptable_max_annual_interest_rate"));
					csinnovationservice.setDebt_finaccing_time(rs.getString("debt_finaccing_time"));
					csinnovationservice.setDebt_fund_use_plan(rs.getString("debt_fund_use_plan"));
					csinnovationservice.setIs_apply_credit_org(rs.getString("is_apply_credit_org"));
					csinnovationservice.setIs_apply_roadshow(rs.getString("is_apply_roadshow"));
					csinnovationservice.setIs_apply_abutment_activity(rs.getString("is_apply_abutment_activity"));
					basicdata.setCsinnovationservice(csinnovationservice);
				}

				// 创业服务需求表
				String MSQlnine = "SELECT * FROM `cs_innovation_service_demand` WHERE rel_id = '" + rel_id
						+ "' LIMIT 1 ";
				rs = st.executeQuery(MSQlnine);
				CsInnovationServiceDemand csinnovationservicedemand;
				while (rs.next()) {
					csinnovationservicedemand = new CsInnovationServiceDemand();
					csinnovationservicedemand.setId(rs.getString("id"));
					csinnovationservicedemand.setRel_id(rs.getString("rel_id"));
					csinnovationservicedemand.setCrowdfunding(rs.getString("crowdfunding"));
					csinnovationservicedemand.setMerge(rs.getString("merge"));
					csinnovationservicedemand.setList(rs.getString("list"));
					csinnovationservicedemand.setFinancing_guarantee(rs.getString("financing_guarantee"));
					csinnovationservicedemand.setMicrofinance(rs.getString("microfinance"));
					csinnovationservicedemand.setMicrofinance_quota(rs.getString("microfinance_quota"));
					csinnovationservicedemand.setTec_import(rs.getString("tec_import"));
					csinnovationservicedemand.setInternational_tec_range(rs.getString("international_tec_range"));
					csinnovationservicedemand.setDomestic_tec_range(rs.getString("domestic_tec_range"));
					csinnovationservicedemand.setTec_transfer(rs.getString("tec_transfer"));
					csinnovationservicedemand.setTec_range(rs.getString("tec_range"));
					csinnovationservicedemand.setProperty_transfer(rs.getString("property_transfer"));
					csinnovationservicedemand.setFinancial_lease(rs.getString("financial_lease"));
					csinnovationservicedemand.setTec_insurance(rs.getString("tec_insurance"));
					csinnovationservicedemand.setAsset_management(rs.getString("asset_management"));
					csinnovationservicedemand.setOccupancy_incubator(rs.getString("occupancy_incubator"));
					csinnovationservicedemand.setPolicy_consultation(rs.getString("policy_consultation"));
					csinnovationservicedemand.setTec_consulting(rs.getString("tec_consulting"));
					csinnovationservicedemand.setIntermediary_consulting(rs.getString("intermediary_consulting"));
					csinnovationservicedemand.setIntermediary_law(rs.getString("intermediary_law"));
					csinnovationservicedemand.setIntermediary_financial(rs.getString("intermediary_financial"));
					csinnovationservicedemand.setIntermediary_financing(rs.getString("intermediary_financing"));
					csinnovationservicedemand.setIntermediary_manage(rs.getString("intermediary_manage"));
					csinnovationservicedemand
							.setOther_service_demand_checkbox(rs.getString("other_service_demand_checkbox"));
					csinnovationservicedemand.setOther_service_demand(rs.getString("other_service_demand"));
					csinnovationservicedemand.setApply_train(rs.getString("apply_train"));
					csinnovationservicedemand.setApply_fund_recommend(rs.getString("apply_fund_recommend"));
					basicdata.setCsinnovationservicedemand(csinnovationservicedemand);
				}

				// 获取审核信息
				String MSQlten = "SELECT remark FROM `cs_user_plan_rel` WHERE id='" + rel_id + "' ";
				rs = st.executeQuery(MSQlten);
				CsUserPlanRel csuserplanrel;
				while (rs.next()) {
					csuserplanrel = new CsUserPlanRel();
					csuserplanrel.setRemark(rs.getString("remark"));
					basicdata.setCsuserplanrel(csuserplanrel);
				}
				// list.add(basicdata);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return basicdata;
	}
	
	/**
	 * 查询学历
	 * @return
	 */
	public static List<CsCoreLeaguerEdu> getXueliList(int tuanduiID){
		String sql="select * from cs_core_leaguer_edu where leaguer_id="+tuanduiID;
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		List<CsCoreLeaguerEdu> list = null;
		try {
			st = conn.createStatement();
			rs = st.executeQuery(sql);
			list = new ArrayList<CsCoreLeaguerEdu>();
			if (rs != null) {
				while (rs.next()) {
					CsCoreLeaguerEdu csCoreLeaguerEdu = new CsCoreLeaguerEdu();
					csCoreLeaguerEdu.setId(rs.getString("id"));
					csCoreLeaguerEdu.setLeaguer_id(rs.getString("leaguer_id"));
					csCoreLeaguerEdu.setDegree_id(rs.getString("degree_id"));
					csCoreLeaguerEdu.setSchool_name(rs.getString("school_name"));
					csCoreLeaguerEdu.setMajor(rs.getString("major"));
					csCoreLeaguerEdu.setGraduation_time(rs.getString("graduation_time"));
					list.add(csCoreLeaguerEdu);
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return list;
	}
	
	
	//查出
	public static CsAttributeCompany getcsattributecompany(String id) {
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		CsAttributeCompany csattributecompany = null;
		String sql = " select * from cs_attribute_company where id='"+id+"'";
		try {
			st = conn.createStatement();
			rs = st.executeQuery(sql);
			if (rs != null) {
				while (rs.next()) {
					csattributecompany=new CsAttributeCompany();
					csattributecompany.setId(rs.getString("id"));
					csattributecompany.setProvince_id(rs.getString("province_id"));
					csattributecompany.setCity_id(rs.getString("city_id"));
					csattributecompany.setAttribute_type(rs.getString("attribute_type"));
					csattributecompany.setAttribute_name(rs.getString("attribute_name"));
					csattributecompany.setSort(rs.getString("sort"));
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return csattributecompany;
	}
	//查询出曾经获奖权限
	public static Map<String, String> getevenbear(String id) {
		Connection conn = Connectiondb.getConnection();
		Statement st = null;
		ResultSet rs = null;
		Map<String,String> mm=new HashMap<String,String>();
		String sql = " select * from cs_base_select where id='"+id+"'";
		
		try {
			st = conn.createStatement();
			rs = st.executeQuery(sql);
			if (rs != null) {
				while (rs.next()) {
					mm.put("id", ""+rs.getString("id")+"");
					mm.put("name", ""+rs.getString("option_name")+"");
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			Connectiondb.closeDb(conn, st, rs);
		}
		return mm;
	}
}
